package edu.sfsu.powerrangers.jeopardy.contestant;

import java.rmi.NotBoundException;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.rmi.server.UnicastRemoteObject;
import edu.sfsu.powerrangers.jeopardy.ContestantClient;
import edu.sfsu.powerrangers.jeopardy.ContestantServer;

public class ContestantApplication {
	public static void main(String[] args) throws RemoteException, NotBoundException {
		// TODO Auto-generated method stub
		
		// make these configurable, perhaps as text fields on the login screen
		String rmiServer = "668.tesladethray.com";
		String rmiName = "wtq";
		String contestantName = "Ken Nguyennings";
		int startingScore = 0;
		
		// replace null with your object that implements ContestantClient
		ContestantClient client = null;
		
		// do these steps to log in
		Registry registry = LocateRegistry.getRegistry(rmiServer);
		ContestantServer server = (ContestantServer)registry.lookup(rmiName);
		client = (ContestantClient)UnicastRemoteObject.exportObject(client, 0);
		server.loginContestant(client, contestantName, startingScore);
	}
}
